# 2022.10.27课上  读取Excel表数据
import unittest
import ddt
import xls_unitls

testData = [[1, 2, 3],
            [4, 5, 6],
            [7, 8, 9]]

test_testData = xls_unitls.getExcelData(r"C:\Users\29102\Desktop\ddtTest.xls", "Sheet1")

@ddt.ddt
class DDTTest(unittest.TestCase):
    @ddt.data(*test_testData)
    @ddt.unpack
    def test_test(self, param1, param2):
        print(param1, param2)

    def add(self, num1, num2):
        return num1 + num2

    def mul2(self, num):
        return 2 * num

    # @ddt.data(*testData)
    # @ddt.unpack
    # def test_add1(self, numA, numB, sum):
    #     s = self.add(numA, numB)
    #     self.assertEqual(s, sum)

    # @ddt.data([2,4],[3,6],[4,10])
    # @ddt.unpack
    # def test_mul1(self, num, multi):
    #     m = 2 * num
    #     self.assertEqual(m,multi)

if __name__ == "__main__":
    unittest.main()
